<!DOCTYPE html>
<html>
<head>
<title></title> <@h.head />


<style type="text/css">
body {
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}

@media ( max-width : 980px) {
	/* Enable use of floated navbar text */
	.navbar-text.pull-right {
		float: none;
		padding-left: 5px;
		padding-right: 5px;
	}
}
</style>
</head>
<body>
	<form class="form-inline definewidth m20" action="${path}/level/list" method="get" id="listForm">
		<!--标题： <input type="text" name="likeTitle" id="likeTitle"-->
			<!--class="abc input-default" placeholder="输入待查询的试卷标题">&nbsp;&nbsp;-->
		<!--<button type="submit" class="btn btn-primary">查询</button>-->
		<a class="btn btn-success" href="${path}/level/add">新增考试等级</a>
	</form>
	<table class="table table-bordered table-hover definewidth m10">
		<thead>
			<tr>
				<th style="width: 30px">序号</th>
				<th>等级名称</th>
				<th>考试时间</th>
				<th>显示顺序</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<#assign constant  = pagination.currentResult>
			<#list list as u>
			<#assign sum =u_index + constant + 1>
			<tr class="">
				<td>${(sum)!}</td>
				<td>${(u.name)!""}</td>
				<td>
					<#if (u.examTime)??>
						${u.examTime?string("yyyy-MM-dd")}
					</#if>
				</td>
				<td>${(u.showOrder!0)}</td>
				<td>
					<a class="edit" href="${path}/level/modify?id=${(u.id)!''}">修改</a>
					<a class="edit" href="javascript:void(0)" onclick="delLevel(${(u.id)!0})">删除</a>
				</td>
			</tr>
			</#list>
		</tbody>
	</table>
		<@h.page /> <@h.foot />
	<!--<script src="${path}/static/artDialog7/lib/jquery-1.10.2.js"></script>-->
	<script src="${path}/static/artDialog7/dist/dialog.js"></script>
	<script type="text/javascript">
        function delLevel(id) {
            if (confirm("确定删除该试卷?")) {
                var url = "${path}/level/delete";
                $.ajax({
                    cache: true,
                    type: "POST",
                    traditional: true,
                    url: url,
                    data: {id:id},
                    async: false,
                    error: function (request) {
                        alert("请求出问题.");
                    },
                    success: function (data) {
                        var myData = JSON.parse(data);
                        if (myData.status == "0") {
                            window.location.href = "${path}/level/list";
                        } else {
                            alert(data.status + "==" + data.msg);
                        }
                    }
                });
            }
        }
	</script>
</body>
</html>
